<template>
  <!-- <div>
      <MkButtonQueryHistory @click="listRef.open()" />
      <MkButtonAdd @click="newEntity" :isEdit="ctx.isEdit" />
      <MkButtonSubmit @click="submit" :loading="ctx.loading" :isEdit="ctx.isEdit" />
      <MkButtonMore>
        <a-menu-item @click="billPanelRef.showCaoZuo()">操作记录</a-menu-item>
      </MkButtonMore>
      <MkButtonMore title="打印" @click="print" icon="ele-Printer">
        <a-menu-item @click="print">打印</a-menu-item>
      </MkButtonMore>
    </div> -->
  <!-- <MkPanel title="退血信息">
   -->
  <MkPanelEdit title="" :showButton="!isNull(ctx.tuiXue.danJuZhuangTai) && ctx.tuiXue.danJuZhuangTai != '已发血'"
    @save="updateTuiXueMingXi">
    <div style="display: flex; gap: 10px; align-items: center;">
      <MkXueYeScanInput ref="scanRef" @onEnter="scanEnter" width="400px" scanInpWidth="400px" placeholder="请扫血液条码" />

      <div style="width:400px" class="mkScanInput">
        <el-input v-model.trim="ctx.tuiXue.tuiXueYuanYing" placeholder="退血原因" autocomplete="off" class="text">
        </el-input>
      </div>

    </div>


    <!-- <MkScanInput ref="codeScanRef" @onEnter="scanBillEnter" placeholder="请扫发血单号" width="400px" /> -->

    <MkTable :data="ctx.traTuiXueMingXiList" default-expand-all>
      <el-table-column type="expand" fixed>
        <template #default="{ row }">
          <MkTextXueYe :xueYe="row.invKuCun" style="margin-left: 50px;" />
        </template>
      </el-table-column>
      <MkColumnIndex />
      <MkColumn prop="code" label="血袋号" />
      <MkColumn prop="tuiXueShiJian" label="退血时间" />
      <MkColumn prop="tuiXueYuanYing" label="退血原因" />
      <MkColumn prop="tuiXueShiJian" label="退血时间" />
      <el-table-column label="操作" width="120px" fixed="right" v-if="ctx.isEdit">
        <template #default="{ row }">
          <el-button icon="ele-Delete" size="small" text type="danger" @click="delBlood(row)">删除</el-button>
        </template>
      </el-table-column>
    </MkTable>
  </MkPanelEdit>
  <!-- </MkPanel> -->


</template>

<script lang="ts" setup>
import {
  isNull
} from '/@/utils'
import {
  listRef,
  billPanelRef,
  ctx,
  newEntity,
  submit,
  scanEnter,
  scanBillEnter,
  updateTuiXueMingXi,
  delBlood,
  print
} from './index'

</script>
<style lang='scss' scoped>
@use './index.scss';
</style>